<script setup>
import { useRoute,useRouter } from 'vue-router';
import { ElMessage,ElMessageBox  } from 'element-plus';

const props = defineProps({
    uuid:{
        default:"",
        type:[String,Number]
    }
})

const seachTable = ref(null);
const route = useRoute();
const router = useRouter();
const instance = getCurrentInstance();

// 新增编辑回退时候刷新列表
onActivated(()=>{

})
const formInline = ref([

])

const btnLefts = ref([
])
const btnRights = ref([
])

const tableConfig = ref([
    {
      prop: "storeName",
      label: "变动类型",
    },
    {
      prop: "reserveStartTime",
      label: "积分变动",
    },
    {
      prop: "storeName",
      label: "结存",

    },
    {
      prop: "reserveStartTime",
      label: "备注",
    },
    {
      prop: "storeName",
      label: "时间",
    },
    {
      prop: "reserveStartTime",
      label: "操作门店",
    },
]);
const tableLoading = ref(false)
const totalPage = ref(0)
const tableData = ref([]);


const handlerSearch = async (formInline)=>{
    tableLoading.value = true;
    try{
        let params = {};
        for (const key in formInline) {
            if(key == 'page'){
                params["page.current"] = formInline[key].current;
                params["page.size"] = formInline[key].size;
            }else{
                params[key] = formInline[key]
            }
        }
        totalPage.value = 0;
        tableData.value = [
            {
                id:2323
            }
        ];
        tableLoading.value = false;
    }catch(e){
        tableLoading.value = false;
    }
}


</script>
<template>
    <div class="page-content">
        <SeachTable 
          :tableType="1"
          ref="seachTable"
          :forms="formInline"
          :btnLefts="btnLefts"
          :btnRights="btnRights"
          :tableLoading="tableLoading"
          :tableConfig="tableConfig"
          :tableData="tableData"
          :totalPage="totalPage"
          @handlerSearch="handlerSearch"
          :showLine="false"
          :showBtn="false"
        >

        </SeachTable>
    </div>
</template>
<style lang="less" scoped>

:deep(.search-line){
    padding:0;
}
:deep(.search-table .table){
    padding:0;
}
.text-info{
    width: 100%;
    font-size: 14px;
    font-weight: 400;
    line-height: 14px;
    color: #222222;
}
</style>